package com.haier.iot.dubbo.controller;

import com.haier.iot.dubbo.service.AccountService;
import com.haier.iot.dubbo.service.OrderService;
import com.haier.iot.dubbo.service.StorageService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Zhang Tianhui 2021/10/14
 * @version 1.0.0
 */
@RestController
public class OrderController {

    @DubboReference
    private AccountService accountService;

    @DubboReference
    private OrderService orderService;

    @DubboReference
    private StorageService storageService;

    @GetMapping("/dubbo/order")
    public String getAccount() {
        return String.format("order: %s, storage: %s, account: %s",
                orderService.getOrder(), storageService.getStorage(), accountService.getAccount());
    }
}
